package com.link.base.base.user.model;

import java.io.Serializable;

/**
 * @author unknown
 * @date unknown
 */
public class RespDTO<T> implements Serializable {
    private int code;
    private String error;
    private T data;

    public RespDTO() {
        this.code = 0;
        this.error = "";
    }

    public static RespDTO onSuc(Object data) {
        RespDTO resp = new RespDTO();
        resp.data = data;
        return resp;
    }

    @Override
    public String toString() {
        return "RespDTO{code=" + this.code + ", error='" + this.error + '\'' + ", data=" + this.data + '}';
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setError(String error) {
        this.error = error;
    }

    public int getCode() {
        return this.code;
    }

    public String getError() {
        return this.error;
    }

    public void setData(T data) {
        this.data = data;
    }

    public T getData() {
        return this.data;
    }
}
